package cn.smvc.task.dao;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import cn.smvc.task.entity.TTimedTask;

@Repository
public interface TTimedTaskDao {
	
	public List<TTimedTask> findAll() throws SQLException;
	
	public List<TTimedTask> findAllTaskGroup() throws SQLException;
	
	public List<TTimedTask> findAll(TTimedTask task) throws SQLException;
	
	public TTimedTask findOne(String id) throws SQLException;
	
	public int save(TTimedTask task) throws SQLException;
	
	public int update(TTimedTask task) throws SQLException;
	
	public int updateRunFlag(String id, String runFlag) throws SQLException;
	
	public int delete(String id) throws SQLException;
	
	public int count() throws SQLException;
	
	public int count(String where) throws SQLException;
	
	public int updateNextExecuteDatetime(String nextExecuteTimestamp, String nextExecuteDatetime, String id) 
			throws SQLException;
	
	public int updateNextAndLastExecuteDatetime(
			String nextExecuteTimestamp, String nextExecuteDatetime, 
			String lastExecuteTimestamp, String lastExecuteDatetime,String id) 
			throws SQLException;
	
	public int updateAllRunFlag(String runFlag) throws SQLException;
	
	public List<TTimedTask> findBySql(String sql) throws SQLException;
	
	public List<TTimedTask> findByWhere(String where) throws SQLException;
	
	public List<TTimedTask> findPage(String where, int page, int limit, String orderBy) throws SQLException;
}
